home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
11587
/
11587.xpi
/
chrome
/
aviary.jar
/
content
/
actionPrompt.xul
next >
Wrap
Extensible Markup Language
|
2009-07-08
|
4KB
|
123 lines
<?xml version="1.0"?>
<!-- Copyright (c) 2009 Pearl Crescent, LLC. All Rights Reserved. -->
<!-- vim: set sw=2 sts=2 ts=8 et syntax=xml: -->
<!DOCTYPE window [
<!ENTITY % aviaryDTD SYSTEM "chrome://aviary/locale/extension.dtd">
%aviaryDTD;
<!ENTITY % dlogoverlayDTD SYSTEM "chrome://global/locale/dialogOverlay.dtd">
%dlogoverlayDTD;
]>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://aviary/skin/browserOverlay.css"
type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<window id="aviary-actionPrompt"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="doInit();">
<script type="application/x-javascript"
src="chrome://aviary/content/pearlutil.js"/>
<script type="application/x-javascript">
<![CDATA[
// These constants are also in browserOverlay.js
const kActionNone = 0;
const kActionSaveToAviary = 1;
const kActionSaveAndOpen = 2;
const kActionSaveToDesktop = 3;
const kActionCopyToClipboard = 4;
var gPearlUtil = com.aviary.talon.pearlutil;
var gParamObj = null;
function doInit()
{
window.document.title = gPearlUtil.GetLocalizedString("ALERT_TITLE");
gParamObj = window.arguments[0];
doSetOKCancel(null, doCancel, null, null);
window.sizeToContent();
}
function onSaveToAviary()
{
if (!gParamObj || !gParamObj.authService || !gParamObj.loginURL)
return;
if (gParamObj.authService.isLoggedIn)
{
returnResult(kActionSaveToAviary);
return;
}
const knsIPS = Components.interfaces.nsIPromptService;
var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(knsIPS);
var title = gPearlUtil.GetLocalizedString("ALERT_TITLE");
var msg = gPearlUtil.GetLocalizedString("NOT_LOGGED_IN");
var btn0Label = gPearlUtil.GetLocalizedString("LOGIN_BUTTON_LABEL");
var flags = (knsIPS.BUTTON_POS_0 * knsIPS.BUTTON_TITLE_IS_STRING)
+ knsIPS.BUTTON_POS_0_DEFAULT
+ (knsIPS.BUTTON_POS_1 * knsIPS.BUTTON_TITLE_CANCEL);
var notUsed = { value: false };
var rv = ps.confirmEx(window, title, msg, flags, btn0Label,
null, null, null, notUsed);
if (0 == rv) // Login
window.opener.openNewWindowWith(gParamObj.loginURL);
}
function doCancel()
{
returnResult(kActionNone);
}
function returnResult(aAction)
{
if (gParamObj)
gParamObj.action = aAction;
window.close();
}
]]>
</script>
<keyset id="dialogKeys"/>
<vbox flex="100%" style="min-width: 1px">
<description>&actionPromptQuestion.label;</description>
<grid flex="1">
<columns><column/><column/></columns>
<rows>
<row>
<button label="&actionPromptEditButton.label;"
image="chrome://aviary/skin/edit.png"
orient="vertical"
oncommand="returnResult(kActionSaveAndOpen);"/>
<button label="&actionPromptSaveDesktopButton.label;"
image="chrome://aviary/skin/save.png"
orient="vertical"
oncommand="returnResult(kActionSaveToDesktop);"/>
</row>
<row>
<button label="&actionPromptClipboardButton.label;"
image="chrome://aviary/skin/clipboard2.png"
orient="vertical"
oncommand="returnResult(kActionCopyToClipboard);"/>
<button id="saveToAviary"
label="&actionPromptSaveToAviaryButton.label;"
image="chrome://aviary/skin/online.png"
orient="vertical"
oncommand="onSaveToAviary();"/>
</row>
</rows>
</grid>
<hbox>
<spacer flex="1"/>
<button id="cancel" label="&cancelButton.label;"
oncommand="doCancel();"/>
<spacer flex="1"/>
</hbox>
</vbox>
</window>